package cn.itsource.hrm.feign.fallback;

import cn.itsource.hrm.feign.clients.SystemEmpControllerClient;
import cn.itsource.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class SystemEMPFallbackFactory implements FallbackFactory<SystemEmpControllerClient>{

    @Override
    public SystemEmpControllerClient create(Throwable throwable) {
        return new SystemEmpControllerClient() {
            @Override
            public AjaxResult selectUserInfo(Long id) {
                throwable.printStackTrace();
                return AjaxResult.me().setSuccess(false).setMessage("调用SystemeFeign,熔断降价");
            }
        };
    }
}

